package com.hirsi.common.db.developer.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 开发者购买产品订单表
 * </p>
 *
 * @author 封夕
 * @since 2023-10-25
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("ztk_developer_order")
public class DeveloperOrder extends Model<DeveloperOrder> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 订单编号
     */
    @TableField("order_no")
    private String orderNo;

    /**
     * 价格id
     */
    @TableField("price_id")
    private Integer priceId;

    /**
     * 订单状态：0-待支付，1-已支付
     */
    @TableField("status")
    private Byte status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 支付时间
     */
    @TableField("pay_time")
    private LocalDateTime payTime;

    /**
     * 开发者编码
     */
    @TableField("developer_code")
    private String developerCode;

    /**
     * 逻辑删除字段：0-未删除，null-已删除
     */
    @TableField("deleted")
    private Boolean deleted;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
